package com.yjd.comm.merchant.service;

import com.yjd.comm.base.service.IBaseService;
import com.yjd.comm.merchant.model.MerchantCashModel;

/**
 * <b>description</b>：商户提现记录表业务接口<br>
 * <b>time</b>：2017-10-19 15:50:41 <br>
 * <b>author</b>：  carl
 */
public interface IMerchantCashService extends IBaseService {
	/**
	 * 插入
	 * 
	 * @param model
	 * @return
	 * @throws Exception
	 */
	public MerchantCashModel insert(MerchantCashModel model) throws Exception;

	/**
	 * 更新,大于等于1表示成功，其他失败
	 * 
	 * @param model
	 * @return
	 * @throws Exception
	 */
	public int update(MerchantCashModel model) throws Exception;

	/**
	 * 根据id删除,大于等于1表示成功，其他失败
	 * 
	 * @param id
	 * @return
	 * @throws Exception
	 */
	public int delete(long id) throws Exception;

	/**
	 * 商户提现（商户账户减钱，记录相关流水）
	 *
	 * @param cash
	 * @return
	 * @throws Exception
	 */
	public void merchantCashOut(MerchantCashModel cash) throws Exception;

	/**
	 * 统计指定时间段内提现金额
	 * @param startTime
	 * @param endTime
	 * @return
	 * @throws Exception
	 */
	public Double querySumCash(Long startTime,Long endTime)throws Exception;

}
